﻿using Dyao.Book.Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Dyao.Book.Repository
{
    public class BookSourceWarehouseEntityTypeConfiguration : IEntityTypeConfiguration<BookSourceWarehouseEntity>
    {
        public void Configure(EntityTypeBuilder<BookSourceWarehouseEntity> builder)
        {
            builder.Property(a => a.Enabled).HasBoolToStringConversion();
            builder.Property(a => a.IsDel).HasBoolToStringConversion();
            builder.HasQueryFilter(a => a.IsDel == false);
        }
    }
}
